% Author:
% Date: 2/19/2012

:- module(qasystem, [evaluate/3]).
:- use_module(data,[data/2]).

member(X, [X|_]).
member(X, [_|Tail]) :- member(X, Tail).

apply(Functor, Argument, Result) :- Functor= lambda(Argument, Result).

evaluate(Expression, Result,Predicate):-
                             apply(Expression, X, Term),							 
                             data(Predicate,Model),
                             member(Term, Model),
							 arg(1,Expression, Result).

